﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using FrameBLL;
using FrameEngine;
using wpfUI.CommandUI;
using wpfUI.ToolAndCommand;

namespace WpfMainForm
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        //宿主对象
        private IApplication _App = null;

        public MainWindow()
        {
            InitializeComponent();
            this._App = new FrameApplication(this.image1);
            this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
        }

        void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            object style = FindResource("MenuItemStyle");
       
           MenuItem menuItem = new MenuItem();
            menuItem.Header = "文件";
            menuItem.Style = style as System.Windows.Style;
            menuItem.Items.Add(new CommandUIOfMenuItem(new CreatTool(this._App)));
            menuItem.Items.Add(new CommandUIOfMenuItem(new NewFolderCommand(this._App)));
            this.menu1.Items.Add(menuItem);

            this.toolBarPanel1.Items.Add(new CommandUIOfToolBarButton(new EditTool(this._App)));

        }
        
    }
}
